package com.example.weather.controller;

import com.example.weather.pojo.Result;
import com.example.weather.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/weather")
public class GetWeatherController {
    @Autowired
    private WeatherService weatherService;

    @GetMapping("/list")
    public Result getWeather(String city) {
        return Result.success(weatherService.getWeather(city));
    }

}
